home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / wemdemo4.zip / INFO / ELISP.21 < prev    next >
Text File  |  1994-09-21  |  50KB  |  1,217 lines

  1. Info file elisp, produced by Makeinfo, -*- Text -*- from input file
  2. elisp.texi.
  3.  
  4.    This file documents GNU Emacs Lisp.
  5.  
  6.    This is edition 1.03 of the GNU Emacs Lisp Reference Manual,   for
  7. Emacs Version 18.
  8.  
  9.    Published by the Free Software Foundation, 675 Massachusetts
  10. Avenue,  Cambridge, MA 02139 USA
  11.  
  12.    Copyright (C) 1990 Free Software Foundation, Inc.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of
  15. this manual provided the copyright notice and this permission notice
  16. are preserved on all copies.
  17.  
  18.    Permission is granted to copy and distribute modified versions of
  19. this manual under the conditions for verbatim copying, provided that
  20. the entire resulting derived work is distributed under the terms of a
  21. permission notice identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that this permission notice may be stated in a
  26. translation approved by the Foundation.
  27.  
  28.  
  29. 
  30. File: elisp,  Node: Deleting Processes,  Next: Process Information,  Prev: Asynchronous Processes,  Up: Processes
  31.  
  32. Deleting Processes
  33. ==================
  34.  
  35.    "Deleting a process" disconnects Emacs immediately from the
  36. subprocess, and removes it from the list of active processes.  It
  37. sends a signal to the subprocess to make the subprocess terminate,
  38. but this is not guaranteed to happen immediately.  (The process
  39. object itself continues to exist as long as other Lisp objects point
  40. to it.)
  41.  
  42.    You can delete a process explicitly at any time.  Processes are
  43. deleted automatically after they terminate, but not necessarily right
  44. away.  If you delete a terminated process explicitly before it is
  45. deleted automatically, no harm results.
  46.  
  47.  * Variable: delete-exited-processes
  48.      This variable controls automatic deletion of processes that have
  49.      terminated (due to calling `exit' or to a signal).  If it is
  50.      `nil', then they continue to exist until the user runs
  51.      `list-processes'.  Otherwise, they are deleted immediately after
  52.      they exit.
  53.  
  54.  * Function: delete-process NAME
  55.      This function deletes the process associated with NAME.  The
  56.      argument NAME may be a process, the name of a process, a buffer,
  57.      or the name of a buffer.  The subprocess is killed with a
  58.      `SIGHUP' signal.
  59.  
  60.           (delete-process "*shell*")
  61.                => nil
  62.  
  63.  * Function: process-kill-without-query PROCESS
  64.      This function declares that Emacs need not query the user if
  65.      PROCESS is still running when Emacs is exited.  The process will
  66.      be deleted silently.  The value is `t'.
  67.  
  68.           (process-kill-without-query (get-process "shell"))
  69.                => t
  70.  
  71.  
  72. 
  73. File: elisp,  Node: Process Information,  Next: Input to Processes,  Prev: Deleting Processes,  Up: Processes
  74.  
  75. Process Information
  76. ===================
  77.  
  78.    Several functions return information about processes. 
  79. `list-processes' is provided for interactive use.
  80.  
  81.  * Command: list-processes
  82.      This command displays a listing of all living processes.  (Any
  83.      processes listed as `Exited' or `Signaled' are actually
  84.      eliminated after the listing is made.)  This function returns
  85.      `nil'.
  86.  
  87.  * Function: process-list
  88.      This function returns a list of all processes that have not been
  89.      deleted.
  90.  
  91.           (process-list)
  92.                => (#<process display-time> #<process shell>)
  93.  
  94.  * Function: get-process NAME
  95.      This function returns the process named NAME, or `nil' if there
  96.      is none.  An error is signaled if NAME is not a string.
  97.  
  98.           (get-process "shell")
  99.                => #<process shell>
  100.  
  101.  * Function: process-command PROCESS
  102.      This function returns the command that was executed to start
  103.      PROCESS.  This is a list of strings, the first string being the
  104.      program executed and the rest of the strings being the arguments
  105.      that were given to the program.
  106.  
  107.           (process-command (get-process "shell"))
  108.                => ("/bin/csh" "-i")
  109.  
  110.  * Function: process-exit-status PROCESS
  111.      This function returns the exit status of PROCESS or the signal
  112.      number that killed it.  If PROCESS has not yet terminated, the
  113.      value is 0.
  114.  
  115.  * Function: process-id PROCESS
  116.      This function returns the PID of PROCESS.  This is an integer
  117.      which distinguishes the process PROCESS from all other processes
  118.      running on the same computer at the current time.  The PID of a
  119.      process is chosen by the operating system kernel when the
  120.      process is started and remains constant as long as the process
  121.      exists.
  122.  
  123.  * Function: process-name PROCESS
  124.      This function returns the name of PROCESS.
  125.  
  126.  * Function: process-status PROCESS-NAME
  127.      This function returns the status of PROCESS-NAME as a symbol. 
  128.      The argument PROCESS-NAME must be either a process or a string. 
  129.      If it is a string, it need not name an actual process.
  130.  
  131.      The possible values for an actual subprocess are:
  132.  
  133.     `run'
  134.           for a process that is running.
  135.  
  136.     `stop'
  137.           for a process that is stopped but continuable.
  138.  
  139.     `exit'
  140.           for a process that has exited.
  141.  
  142.     `signal'
  143.           for a process that has received a fatal signal.
  144.  
  145.     `nil'
  146.           if PROCESS-NAME is not the name of an existing process.
  147.  
  148.           (process-status "shell")
  149.                => run
  150.           (process-status "never-existed")
  151.                => nil
  152.           x
  153.                => #<process xx<1>>
  154.           (process-status x)
  155.                => exit
  156.  
  157.      For a network stream, `process-status' returns one of the
  158.      symbols `open' or `closed'.  The latter means that the other
  159.      side closed the connection, or Emacs did `delete-process'.
  160.  
  161.  
  162. 
  163. File: elisp,  Node: Input to Processes,  Next: Signals to Processes,  Prev: Process Information,  Up: Processes
  164.  
  165. Sending Input to Processes
  166. ==========================
  167.  
  168.    Asynchronous subprocesses receive input when it is sent to them by
  169. Emacs, which is done with the functions in this section.  You must
  170. specify the process to send input to, and the input data to send. 
  171. The data appears on the "standard input" of the subprocess.
  172.  
  173.    Some operating systems have limited space for buffered input in a
  174. PTY.  On these systems, the subprocess will cease to read input
  175. correctly if you send an input line longer than the system can handle.
  176. You cannot avoid the problem by breaking the input into pieces and
  177. sending them separately, for the operating system will still have to
  178. put all the pieces together in the input buffer before it lets the
  179. subprocess read the line.  The only solution is to put the input in a
  180. temporary file, and send the process a brief command to read that file.
  181.  
  182.  * Function: process-send-string PROCESS-NAME STRING
  183.      This function sends PROCESS-NAME the contents of STRING as
  184.      standard input.  The argument PROCESS-NAME must be a process or
  185.      the name of a process.
  186.  
  187.      The function returns `nil'.
  188.  
  189.           (process-send-string "shell<1>" "ls\n")
  190.                => nil
  191.  
  192.              ---------- Buffer: *shell* ----------
  193.           ...
  194.           introduction.texi               syntax-tables.texi~
  195.           introduction.texi~              text.texi
  196.           introduction.txt                text.texi~
  197.           ...
  198.           ---------- Buffer: *shell* ----------
  199.  
  200.  * Command: process-send-region PROCESS-NAME START END
  201.      This function sends the text in the region defined by START and
  202.      END as standard input to PROCESS-NAME, which is a process or a
  203.      process name.
  204.  
  205.      An error is signaled unless both START and END are integers or
  206.      markers that indicate positions in the current buffer.  (It is
  207.      unimportant which number is larger.)
  208.  
  209.  * Function: process-send-eof &optional PROCESS-NAME
  210.      This function makes PROCESS-NAME see an end-of-file in its
  211.      input.  The EOF comes after any text already sent to it.
  212.  
  213.      If PROCESS-NAME is not supplied, or if it is `nil', then this
  214.      function sends the EOF to the current buffer's process.  An
  215.      error is signaled if the current buffer has no process.
  216.  
  217.      The function returns PROCESS-NAME.
  218.  
  219.           (process-send-eof "shell")
  220.                => "shell"
  221.  
  222.  
  223. 
  224. File: elisp,  Node: Signals to Processes,  Next: Output from Processes,  Prev: Input to Processes,  Up: Processes
  225.  
  226. Sending Signals to Processes
  227. ============================
  228.  
  229.    "Sending a signal" to a subprocess is a way of interrupting its
  230. activities.  There are several different signals, each with its own
  231. meaning.  For example, the signal `SIGINT' means that the user has
  232. typed `C-c', or that some analogous thing has happened.
  233.  
  234.    Each signal has a standard effect on the subprocess.  Most signals
  235. kill the subprocess, but some stop or resume execution instead.  Most
  236. signals can optionally be handled by programs; if the program handles
  237. the signal, then we can say nothing in general about its effects.
  238.  
  239.    The set of signals and their names is defined by the operating
  240. system; Emacs has facilities for sending only a few of the signals
  241. that are defined.  Emacs can send signals only to its own subprocesses.
  242.  
  243.    You can send signals explicitly by calling the function in this
  244. section.  Emacs also sends signals automatically at certain times:
  245. killing a buffer sends a `SIGHUP' signal to all its associated
  246. processes; killing Emacs sends a `SIGHUP' signal to all remaining
  247. processes.  (`SIGHUP' is a signal that usually indicates that the
  248. user hung up the phone.)
  249.  
  250.    Each of the signal-sending functions takes two optional arguments:
  251. PROCESS-NAME and CURRENT-GROUP.
  252.  
  253.    The argument PROCESS-NAME must be either a process, the name of
  254. one, or `nil'.  If it is `nil', the process defaults to the process
  255. associated with the current buffer.  An error is signaled if
  256. PROCESS-NAME does not identify a process.
  257.  
  258.    The argument CURRENT-GROUP is a flag that makes a difference when
  259. you are running a job-control shell as an Emacs subprocess.  If it is
  260. non-`nil', then the signal is sent to the current process-group of
  261. the terminal which Emacs uses to communicate with the subprocess.  If
  262. the process is a job-control shell, this means the shell's current
  263. subjob.  If it is `nil', the signal is sent to the process group of
  264. the immediate subprocess of Emacs.  If the subprocess is a
  265. job-control shell, this is the shell itself.
  266.  
  267.    The flag CURRENT-GROUP has no effect when a pipe is used to
  268. communicate with the subprocess, because the operating system does
  269. not support the distinction in the case of pipes.  For the same
  270. reason, job-control shells won't work when a pipe is used.  See
  271. `process-connection-type' in *Note Asynchronous Processes::.
  272.  
  273.  * Function: interrupt-process &optional PROCESS-NAME CURRENT-GROUP
  274.      This function interrupts the process PROCESS-NAME by sending the
  275.      Unix signal `SIGINT'.  Outside of Emacs, typing the "interrupt
  276.      character" (usually `C-c' on Berkeley Unix) sends this signal. 
  277.      When the argument CURRENT-GROUP is non-`nil', you can think of
  278.      this function as "typing `C-c'" on the terminal by which Emacs
  279.      talks to the subprocess.
  280.  
  281.  * Function: kill-process &optional PROCESS-NAME CURRENT-GROUP
  282.      This function kills the process PROCESS-NAME by sending the Unix
  283.      signal `SIGKILL'.  This signal kills the subprocess immediately,
  284.      and cannot be handled by the subprocess.
  285.  
  286.  * Function: quit-process &optional PROCESS-NAME CURRENT-GROUP
  287.      This function sends the Unix signal `SIGQUIT' to the process
  288.      PROCESS-NAME.  This signal is the one sent by the "quit
  289.      character" (usually `C-b' or `C-\') when you are not inside Emacs.
  290.  
  291.  * Function: stop-process &optional PROCESS-NAME CURRENT-GROUP
  292.      This function stops the process PROCESS-NAME by sending the Unix
  293.      signal `SIGTSTP'.  Use `continue-process' to resume its execution.
  294.  
  295.      On systems with job control, the "stop character" (usually
  296.      `C-z') sends this signal (outside of Emacs).  When CURRENT-GROUP
  297.      is non-`nil', you can think of this function as "typing `C-z'"
  298.      on the terminal Emacs uses to communicate with the subprocess.
  299.  
  300.  * Function: continue-process &optional PROCESS-NAME CURRENT-GROUP
  301.      This function resumes execution of the process PROCESS by
  302.      sending it the Unix signal `SIGCONT'.  This presumes that
  303.      PROCESS-NAME was stopped previously.
  304.  
  305.  
  306. 
  307. File: elisp,  Node: Output from Processes,  Next: Sentinels,  Prev: Signals to Processes,  Up: Processes
  308.  
  309. Receiving Output from Processes
  310. ===============================
  311.  
  312.    There are two ways to receive the output that a subprocess writes
  313. to its standard output stream.  The output can be inserted in a
  314. buffer, which is called the associated buffer of the process, or a
  315. function called the "filter function" can be called to act on the
  316. output.
  317.  
  318. * Menu:
  319.  
  320. * Process Buffers::       If no filter, output is put in a buffer.
  321. * Filter Functions::      Filter functions accept output from the process.
  322. * Accepting Output::      Explicitly permitting subprocess output.
  323.                             Waiting for subprocess output.
  324.  
  325.  
  326. 
  327. File: elisp,  Node: Process Buffers,  Next: Filter Functions,  Prev: Output from Processes,  Up: Output from Processes
  328.  
  329. Process Buffers
  330. ---------------
  331.  
  332.    A process can (and usually does) have an "associated buffer",
  333. which is an ordinary Emacs buffer that is used for two purposes:
  334. storing the output from the process, and deciding when to kill the
  335. process.  You can also use the buffer to identify a process to
  336. operate on, since in normal practice only one process is associated
  337. with any given buffer.  Many applications of processes also use the
  338. buffer for editing input to be sent to the process, but this is not
  339. built into Emacs Lisp.
  340.  
  341.    Unless the process has a filter function (*note Filter
  342. Functions::.), its output is inserted in the associated buffer.  The
  343. position to insert the output is determined by the `process-mark'
  344. (*note Process Information::.), which is then updated to point to the
  345. end of the text just inserted.  Usually, but not always, the
  346. `process-mark' is at the end of the buffer.  If the process has no
  347. buffer and no filter function, its output is discarded.
  348.  
  349.  * Function: process-buffer PROCESS
  350.      This function returns the associated buffer of the process
  351.      PROCESS.
  352.  
  353.           (process-buffer (get-process "shell"))
  354.                => #<buffer *shell*>
  355.  
  356.  * Function: process-mark PROCESS
  357.      This function returns the marker which controls where additional
  358.      output from the process will be inserted in the process buffer
  359.      (*note Process Buffers::.).  When output is inserted, the marker
  360.      is updated to point at the end of the output.  This causes
  361.      successive batches of output to be inserted consecutively.
  362.  
  363.      If PROCESS does not insert its output into a buffer, then
  364.      `process-mark' returns a marker that points nowhere.
  365.  
  366.      Filter functions normally should use this marker in the same
  367.      fashion as is done by direct insertion of output in the buffer. 
  368.      A good example of a filter function that uses `process-mark' is
  369.      found at the end of the following section.
  370.  
  371.      When the user is expected to enter input in the process buffer
  372.      for transmission to the process, the process marker is useful
  373.      for distinguishing the new input from previous output.
  374.  
  375.  * Function: set-process-buffer PROCESS BUFFER
  376.      This function sets the buffer associated with PROCESS to BUFFER.
  377.      If BUFFER is `nil', the process will not be associated with any
  378.      buffer.
  379.  
  380.  * Function: get-buffer-process BUFFER-OR-NAME
  381.      This function returns the process associated with BUFFER-OR-NAME.
  382.      If there are several processes associated with it, then one is
  383.      chosen.  (Presently, the one chosen is the one most recently
  384.      created.)  It is usually a bad idea to have more than one
  385.      process associated with the same buffer.
  386.  
  387.           (get-buffer-process "*shell*")
  388.                => #<process shell>
  389.  
  390.      If the process's buffer is killed, the actual child process is
  391.      killed with a `SIGHUP' signal (*note Signals to Processes::.).
  392.  
  393.  
  394. 
  395. File: elisp,  Node: Filter Functions,  Next: Accepting Output,  Prev: Process Buffers,  Up: Output from Processes
  396.  
  397. Process Filter Functions
  398. ------------------------
  399.  
  400.    A process "filter function" is a function that receives the
  401. standard output from the associated process.  If a process has a
  402. filter, then *all* standard output from that process is passed to the
  403. filter rather than be inserted into a buffer or discarded.  The
  404. process buffer is used for output from the process only when there is
  405. no filter.
  406.  
  407.    A filter function must accept two arguments: the associated
  408. process and a string, which is the output.  The function is then free
  409. to do whatever it chooses with the output.
  410.  
  411.    A filter function runs only while Emacs is waiting (e.g., for
  412. terminal input, or for time to elapse, or for process output).  This
  413. avoids the timing errors that could result from running filters at
  414. random places in the middle of other Lisp programs.  You may
  415. explicitly cause Emacs to wait, so that filter functions will run, by
  416. calling `sit-for', `sleep-for' or `accept-process-output' (*note
  417. Accepting Output::.).  Emacs is also waiting when the command loop is
  418. reading input.
  419.  
  420.    Quitting is normally inhibited within a filter
  421. function--otherwise, the effect of typing `C-g' at command level or
  422. to quit a user command would be unpredictable.  If you want to permit
  423. quitting inside a filter function, bind `inhibit-quit' to `nil'. 
  424. *Note Quitting::.
  425.  
  426.    Many filter functions sometimes or always insert the text in the
  427. process's buffer, mimicking the actions of Emacs when there is no
  428. filter.  Such filter functions need to use `set-buffer' in order to
  429. be sure to insert in that buffer.  To avoid setting the current
  430. buffer semipermanently, these filter functions must use
  431. `unwind-protect' to make sure to restore the previous current buffer.
  432. They should also update the process marker, and in some cases update
  433. the value of point.  Here is how to do these things:
  434.  
  435.      (defun ordinary-insertion-filter (proc string)
  436.        (let ((old-buffer (current-buffer)))
  437.          (unwind-protect
  438.          (let (moving)
  439.            (set-buffer (process-buffer proc))
  440.            (setq moving (= (point) (process-mark proc)))
  441.            (save-excursion
  442.              ;; Insert the text, moving the process-marker.
  443.              (goto-char (process-mark proc))
  444.              (insert string)
  445.              (set-marker (process-mark proc) (point)))
  446.            (if moving (goto-char (process-mark proc))))
  447.            (set-buffer old-buffer))))
  448.  
  449. The reason to use an explicit `unwind-protect' rather than letting
  450. `save-excursion' restore the current buffer is so as to preserve the
  451. change in point made by `goto-char'.
  452.  
  453.    To make the filter force the process buffer to be visible whenever
  454. new text arrives, insert the following line just before the
  455. `unwind-protect':
  456.  
  457.      (display-buffer (process-buffer proc))
  458.  
  459.    To force point to move to the end of the new output no matter
  460. where it was previously, eliminate the variable `moving' and call
  461. `goto-char' unconditionally.
  462.  
  463.    All filter functions that do regexp searching or matching should
  464. save and restore the match data.  Otherwise, a filter function that
  465. runs during a call to `sit-for' might clobber the match data of the
  466. program that called `sit-for'.  *Note Match Data::.
  467.  
  468.    The output to the function may come in chunks of any size.  A
  469. program that produces the same output twice in a row may send it as
  470. one batch of 200 characters one time, and five batches of 40
  471. characters the next.
  472.  
  473.  * Function: set-process-filter PROCESS FILTER
  474.      This function gives PROCESS the filter function FILTER.  If
  475.      FILTER is `nil', then the process will have no filter.
  476.  
  477.  * Function: process-filter PROCESS
  478.      This function returns the filter function of PROCESS, or `nil'
  479.      if it has none.
  480.  
  481.    Here is an example of use of a filter function:
  482.  
  483.      (defun keep-output (process output)
  484.         (setq kept (cons output kept)))
  485.           => keep-output
  486.      (setq kept nil)
  487.           => nil
  488.      (set-process-filter (get-process "shell") 'keep-output)
  489.           => keep-output
  490.      (process-send-string "shell" "ls ~/other\n")
  491.           => nil
  492.      kept
  493.           => ("lewis@slug[8] % "
  494.      "FINAL-W87-SHORT.MSS    backup.otl              kolstad.mss~
  495.      address.txt             backup.psf              kolstad.psf
  496.      backup.bib~             david.mss               resume-Dec-86.mss~
  497.      backup.err              david.psf               resume-Dec.psf
  498.      backup.mss              dland                   syllabus.mss
  499.      "
  500.      "#backups.mss#          backup.mss~             kolstad.mss
  501.      ")
  502.  
  503.    Here is another, more realistic example, which demonstrates how to
  504. use the process mark to do insertion in the same fashion as is done
  505. when there is no filter function:
  506.  
  507.      ;; Insert input in the buffer specified by `my-shell-buffer'
  508.      ;; and make sure that buffer is shown in some window.
  509.      (defun my-process-filter (proc str)
  510.          (let ((cur (selected-window))
  511.                (pop-up-windows t))
  512.            (pop-to-buffer my-shell-buffer)
  513.            (goto-char (point-max))
  514.            (insert str)
  515.            (set-marker (process-mark proc) (point-max))
  516.            (select-window cur)))
  517.  
  518.  
  519. 
  520. File: elisp,  Node: Accepting Output,  Prev: Filter Functions,  Up: Output from Processes
  521.  
  522. Accepting Output from Processes
  523. -------------------------------
  524.  
  525.    Output from asynchronous subprocesses normally arrives only while
  526. Emacs is waiting for some sort of external event, such as elapsed
  527. time or terminal input.  Occasionally it is useful in a Lisp program
  528. to explicitly permit output to arrive at a specific point, or even to
  529. wait until output arrives from a process.
  530.  
  531.  * Function: accept-process-output &optional PROCESS
  532.      This function allows Emacs to read pending output from
  533.      processes.  The output is inserted in the associated buffers or
  534.      given to their filter functions.  If PROCESS is non-`nil' then
  535.      this function does not return until some output has been
  536.      received from PROCESS.
  537.  
  538.  
  539. 
  540. File: elisp,  Node: Sentinels,  Next: VMS Subprocesses,  Prev: Output from Processes,  Up: Processes
  541.  
  542. Sentinels: Detecting Process Status Changes
  543. -------------------------------------------
  544.  
  545.    A "process sentinel" is a function that is called whenever the
  546. associated process changes status for any reason, including signals
  547. (whether sent by Emacs or caused by the process's own actions) that
  548. terminate, stop, or continue the process.  The process sentinel is
  549. also called if the process exits.  The sentinel receives two
  550. arguments: the process for which the event occurred, and a string
  551. describing the type of event.
  552.  
  553.    The string describing the event looks like one of the following:
  554.  
  555.    * `"finished\n"'.
  556.  
  557.    * `"exited abnormally with code EXITCODE\n"'.
  558.  
  559.    * `"NAME-OF-SIGNAL\n"'.
  560.  
  561.    * `"NAME-OF-SIGNAL (core dumped)\n"'.
  562.  
  563.    A sentinel runs only while Emacs is waiting (e.g., for terminal
  564. input, or for time to elapse, or for process output).  This avoids
  565. the timing errors that could result from running them at random
  566. places in the middle of other Lisp programs.  You may explicitly
  567. cause Emacs to wait, so that sentinels will run, by calling
  568. `sit-for', `sleep-for' or `accept-process-output' (*note Accepting
  569. Output::.).  Emacs is also waiting when the command loop is reading
  570. input.
  571.  
  572.    Quitting is normally inhibited within a sentinel--otherwise, the
  573. effect of typing `C-g' at command level or to quit a user command
  574. would be unpredictable.  If you want to permit quitting inside a
  575. sentinel, bind `inhibit-quit' to `nil'.  *Note Quitting::.
  576.  
  577.    All sentinels that do regexp searching or matching should save and
  578. restore the match data.  Otherwise, a sentinel that runs during a
  579. call to `sit-for' might clobber the match data of the program that
  580. called `sit-for'.  *Note Match Data::.
  581.  
  582.  * Function: set-process-sentinel PROCESS SENTINEL
  583.      This function associates SENTINEL with PROCESS.  If SENTINEL is
  584.      `nil', then the process will have no sentinel.  The default
  585.      behavior when there is no sentinel is to insert a message in the
  586.      process's buffer when the process status changes.
  587.  
  588.           (defun msg-me (process event)
  589.              (princ
  590.                (format "Process: %s had the event `%s'" process event)))
  591.           (set-process-sentinel (get-process "shell") 'msg-me)
  592.                => msg-me
  593.           (kill-process (get-process "shell"))
  594.                -| Process: #<process shell> had the event `killed'
  595.                => #<process shell>
  596.  
  597.  * Function: process-sentinel PROCESS
  598.      This function returns the sentinel of PROCESS, or `nil' if it
  599.      has none.
  600.  
  601.  * Function: waiting-for-user-input-p
  602.      While a sentinel or filter function is running, this function
  603.      returns non-`nil' if Emacs was waiting for keyboard input from
  604.      the user at the time the sentinel or filter function was called,
  605.      `nil' if it was not.
  606.  
  607.  
  608. 
  609. File: elisp,  Node: VMS Subprocesses,  Next: TCP,  Prev: Sentinels,  Up: Processes
  610.  
  611. Subprocess Functions for VMS
  612. ============================
  613.  
  614.    The ordinary subprocess functions do not work on VMS in version 18.
  615. Instead, these functions are available.
  616.  
  617.  * Function: default-subprocess-input-handler
  618.      This function is the default input handler for input from
  619.      spawned subprocesses.
  620.  
  621.  * Function: spawn-subprocess INTEGER &optional FILTER SENTINEL
  622.      This function spawns an asynchronous VMS subprocess for command
  623.      processing.  The arguments are INTEGER, an integer to identify
  624.      the subprocess in future operations; FILTER, a function to be
  625.      called when output arrives from the subprocess; and SENTINEL, a
  626.      function to be called when the subprocess terminates.
  627.  
  628.      If FILTER is `nil', output is inserted in the current buffer. 
  629.      If SENTINEL is `nil', nothing special is done when the
  630.      subprocess terminates.
  631.  
  632.      When the filter is called, it receives two arguments; INTEGER to
  633.      identify the process, and a string containing the output.
  634.  
  635.      When the sentinel is called, it receives just one argument,
  636.      INTEGER.
  637.  
  638.  * Function: send-command-to-subprocess INTEGER COMMAND
  639.      This function sends the string COMMAND to a VMS subprocess
  640.      numbered INTEGER.
  641.  
  642.  * Function: stop-subprocess INTEGER
  643.      This function terminates the VMS subprocess numbered INTEGER.
  644.  
  645.    In version 19, these functions have been eliminated, and the
  646. ordinary subprocess functions are implemented on VMS.
  647.  
  648.  
  649. 
  650. File: elisp,  Node: TCP,  Prev: VMS Subprocesses,  Up: Processes
  651.  
  652. TCP
  653. ===
  654.  
  655.    Emacs Lisp programs can open TCP connections to other processes on
  656. the same machine or other machines.  A network connection is handled
  657. by Lisp much like a subprocess, and is represented by a process object.
  658. However, the process you are communicating with is not a child of the
  659. Emacs process, so you can't kill it or send it signals.  All you can
  660. do is send and receive data.  `delete-process' closes the connection,
  661. but does not kill the process at the other end of it.
  662.  
  663.    You can distinguish process objects representing network
  664. connections from those representing subprocesses with the
  665. `process-status' function.
  666.  
  667.  * Function: open-network-stream NAME BUFFER-OR-NAME HOST SERVICE
  668.      This function opens a TCP connection for a service to a host. 
  669.      It returns a process object to represent the connection.
  670.  
  671.      The NAME argument specifies the name for the process object.  It
  672.      is modified as necessary to make it unique.
  673.  
  674.      The BUFFER-OR-NAME argument is the buffer to associate with the
  675.      connection.  Output from the connection is inserted in the
  676.      buffer, unless you specify a filter function to handle the
  677.      output.  If BUFFER-OR-NAME is `nil', it means that the
  678.      connection is not associated with any buffer.
  679.  
  680.      The arguments HOST and SERVICE specify where to connect to; HOST
  681.      is the host name (a string), and SERVICE is the name of the
  682.      service desired (a string) or an integer specifying a port
  683.      number to connect to.
  684.  
  685.  
  686. 
  687. File: elisp,  Node: System Interface,  Next: Emacs Display,  Prev: Processes,  Up: Top
  688.  
  689. Operating System Interface
  690. **************************
  691.  
  692.    This chapter is about starting and getting out of Emacs, access to
  693. values in the operating system environment, and terminal input,
  694. output and flow control.
  695.  
  696.    *Note Building Emacs::, for related information.  See also *Note
  697. Emacs Display::, for additional operating system status information
  698. which pertain to the terminal and the screen.
  699.  
  700. * Menu:
  701.  
  702. * Starting Up::         Customizing Emacs start-up processing.
  703. * Getting Out::         How exiting works (permanent or temporary).
  704. * System Environment::  Distinguish the name and kind of system.
  705. * Terminal Input::      Recording terminal input for debugging.
  706. * Terminal Output::     Recording terminal output for debugging.
  707. * Flow Control::        How to turn output flow control on or off.
  708. * Batch Mode::          Running Emacs without terminal interaction.
  709.  
  710.  
  711. 
  712. File: elisp,  Node: Starting Up,  Next: Getting Out,  Prev: System Interface,  Up: System Interface
  713.  
  714. Starting Up Emacs
  715. =================
  716.  
  717.    This section describes what Emacs does when it is started, and how
  718. you can customize these actions.
  719.  
  720. * Menu:
  721.  
  722. * Start-up Summary::        Sequence of actions Emacs performs at start-up.
  723. * Init File::               Details on reading the init file (`.emacs').
  724. * Terminal-Specific::       How the terminal-specific Lisp file is read.
  725. * Command Line Arguments::  How command line arguments are processed,
  726.                               and how you can customize them.
  727.  
  728.  
  729. 
  730. File: elisp,  Node: Start-up Summary,  Next: Init File,  Prev: Starting Up,  Up: Starting Up
  731.  
  732. Summary: Sequence of Actions at Start Up
  733. ----------------------------------------
  734.  
  735.    The order of operations performed (in `startup.el') by Emacs when
  736. it is started up is as follows:
  737.  
  738.   1. It loads `.emacs' unless `-q' was specified on command line. 
  739.      (This is not done in `-batch' mode.)  `.emacs' is found in the
  740.      user's home directory; the `-u' option can specify the user name
  741.      whose home directory should be used.
  742.  
  743.   2. It loads `default.el' unless `inhibit-default-init' is
  744.      non-`nil'.  (This is not done in `-batch' mode or if `-q' was
  745.      specified on command line.)
  746.  
  747.   3. It loads the terminal-specific Lisp file, if any, except when in
  748.      batch mode.
  749.  
  750.   4. It runs `term-setup-hook'.
  751.  
  752.   5. It runs `window-setup-hook'.
  753.  
  754.   6. It displays copyleft and nonwarranty, plus basic use
  755.      information, unless the value of `inhibit-startup-message' is
  756.      non-`nil'.
  757.  
  758.         This display is also inhibited in batch mode, and if the
  759.      current buffer is not `*scratch*'.
  760.  
  761.   7. It processes any remaining command line arguments.
  762.  
  763.  * User Option: inhibit-startup-message
  764.      This variable inhibits the initial startup messages (the
  765.      nonwarranty, etc.).  If it is non-`nil', then the messages are
  766.      not printed.
  767.  
  768.      This variable exists so you can set it in your personal init
  769.      file, once you are familiar with the contents of the startup
  770.      message.  Do not set this variable in the init file of a new
  771.      user, or in a way that affects more than one user, because that
  772.      would prevent new users from receiving the information they are
  773.      supposed to see.
  774.  
  775.  
  776. 
  777. File: elisp,  Node: Init File,  Next: Terminal-Specific,  Prev: Start-Up Summary,  Up: Starting Up
  778.  
  779. The Init File: `.emacs'
  780. -----------------------
  781.  
  782.    When you start Emacs, it normally attempts to load the file
  783. `.emacs' from your home directory.  This file, if it exists, must
  784. contain Lisp code.  It is called your "init file".  The command line
  785. switches `-q' and `-u' can be used to control the use of the init
  786. file; `-q' says not to load an init file, and `-u' says to load a
  787. specified user's init file instead of yours.  *Note : (emacs)Entering
  788. Emacs.
  789.  
  790.    Emacs may also have a "default init file", which is the library
  791. named `default.el'.  Emacs finds the `default.el' file through the
  792. standard search path for libraries (*note How Programs Do
  793. Loading::.).  The Emacs distribution does not have any such file; you
  794. may create one at your site for local customizations.  If the default
  795. init file exists, it is loaded whenever you start Emacs, except in
  796. batch mode or if `-q' is specified.  But your own personal init file,
  797. if any, is loaded first; if it sets `inhibit-default-init' to a
  798. non-`nil' value, then Emacs will not load the `default.el' file.
  799.  
  800.    If there is a great deal of code in your `.emacs' file, you should
  801. move it into another file named `SOMETHING.el', byte-compile it
  802. (*note Byte Compilation::.), and make your `.emacs' file load the
  803. other file using `load' (*note Loading::.).
  804.  
  805.    *Note : (emacs)Init File Examples, for examples of how to make
  806. various commonly desired customizations in your `.emacs' file.
  807.  
  808.  * User Option: inhibit-default-init
  809.      This variable prevents Emacs from loading the default
  810.      initialization library file for your session of Emacs.  If its
  811.      value is non-`nil', then the default library is not loaded.  The
  812.      default value is `nil'.
  813.  
  814.  
  815. 
  816. File: elisp,  Node: Terminal-Specific,  Next: Command Line Arguments,  Prev: Init File,  Up: Starting Up
  817.  
  818. Terminal-Specific Initialization
  819. --------------------------------
  820.  
  821.    Each terminal type can have its own Lisp library that Emacs will
  822. load when run on that type of terminal.  For a terminal type named
  823. TERMTYPE, the library is called `term/TERMTYPE'.  Emacs finds the
  824. file by searching the `load-path' directories as it does for other
  825. files, and trying the `.elc' and `.el' suffixes.  Normally,
  826. terminal-specific Lisp library is located in `emacs/lisp/term', a
  827. subdirectory of the `emacs/lisp' directory in which most Emacs Lisp
  828. libraries are kept.
  829.  
  830.    The library's name is constructed by concatenating the value of
  831. the variable `term-file-prefix' and the terminal type.  Normally,
  832. `term-file-prefix' has the value `"term/"'; changing this is not
  833. recommended.
  834.  
  835.    The usual purpose of a terminal-specific library is to define the
  836. escape sequences used by a terminal's function keys.  See the file
  837. `term/vt100.el' for an example of a terminal-specific library.
  838.  
  839.    Function keys are handled by a two-level procedure.  The first
  840. level is dependent on the specific type of terminal and maps Emacs's
  841. input sequences to the function keys that they represent.  The second
  842. level is independent of terminal type and is customized by users;
  843. function keys are mapped into meanings at this level.  The
  844. terminal-specific library handles the first level of the process and
  845. the library `keypad.el' handles the second level of mapping.
  846.  
  847.    When the name of the terminal type contains a hyphen, only the
  848. part of the name before the first hyphen is significant in choosing
  849. the library name.  Thus, terminal types `aaa-48' and `aaa-30-rv' both
  850. use the `term/aaa' library.  If necessary, the library can evaluate
  851. `(getenv "TERM")' to find the full name of the terminal type.
  852.  
  853.    Your `.emacs' file can prevent the loading of the
  854. terminal-specific library by setting `term-file-prefix' to `nil'. 
  855. This feature is very useful when experimenting with your own peculiar
  856. customizations.
  857.  
  858.    You can also arrange to override some of the actions of the
  859. terminal-specific library by setting the variable `term-setup-hook'. 
  860. If it is not `nil', Emacs calls the value of the variable
  861. `term-setup-hook' as a function of no arguments at the end of Emacs
  862. initialization, after Emacs has already loaded both your `.emacs'
  863. file and any terminal-specific libraries.  You can use this variable
  864. to define initializations for terminals that do not have their own
  865. libraries.
  866.  
  867.  * Variable: term-file-prefix
  868.      If the `term-file-prefix' variable is non-`nil', Emacs loads a
  869.      terminal-specific initialization file as follows:
  870.  
  871.           (load (concat term-file-prefix (getenv "TERM")))
  872.  
  873.      You may set the `term-file-prefix' variable to `nil' in your
  874.      `.emacs' file if you do not wish to load the
  875.      terminal-initialization file.  To do this, put the following in
  876.      your `.emacs' file: `(setq term-file-prefix nil)'.
  877.  
  878.  * Variable: term-setup-hook
  879.      The value of this variable is either `nil' or a function to be
  880.      called by Emacs after loading your `.emacs' file, the default
  881.      initialization file (if any) and after loading terminal-specific
  882.      Lisp code.  The function is called with no arguments.
  883.  
  884.      You can use `term-setup-hook' to override the definitions made
  885.      by a terminal-specific file.
  886.  
  887.    See also `window-setup-hook' in *Note Window Systems::.
  888.  
  889.  
  890. 
  891. File: elisp,  Node: Command Line Arguments,  Prev: Terminal-Specific,  Up: Starting Up
  892.  
  893. Command Line Arguments
  894. ----------------------
  895.  
  896.    You can use command line arguments to request various actions when
  897. you start Emacs.  Since you do not need to start Emacs more than once
  898. per day, and will often leave your Emacs session running longer than
  899. that, command line arguments are hardly ever used.  As a practical
  900. matter, it is best to avoid making the habit of using them, since
  901. this habit would encourage you to kill and restart Emacs
  902. unnecessarily often.  These options exist for two reasons: to be
  903. compatible with other editors (for invocation by other programs) and
  904. to enable shell scripts to run specific Lisp programs.
  905.  
  906.  * Function: command-line
  907.      This function parses the command line which Emacs was called
  908.      with, processes it, loads the user's `.emacs' file and displays
  909.      the initial nonwarranty information, etc.
  910.  
  911.  * Variable: command-line-processed
  912.      The value of this variable is `t' once the command line has been
  913.      processed.
  914.  
  915.      If you redump Emacs by calling `dump-emacs', you must set this
  916.      variable to `nil' first in order to cause the new dumped Emacs
  917.      to process its new command line arguments.
  918.  
  919.  * Variable: command-switch-alist
  920.      The value of this variable is an alist of user-defined
  921.      command-line options and associated handler functions.  This
  922.      variable exists so you can add elements to it.
  923.  
  924.      A "command line option" is an argument on the command line of
  925.      the form:
  926.  
  927.           -OPTION
  928.  
  929.      The elements of the `command-switch-alist' look like this:
  930.  
  931.           (OPTION . HANDLER-FUNCTION)
  932.  
  933.      For each element, the HANDLER-FUNCTION receives the switch name
  934.      as its sole argument.
  935.  
  936.      In some cases, the option is followed in the command line by an
  937.      argument.  In these cases, the HANDLER-FUNCTION can find all the
  938.      remaining command-line arguments in the variable
  939.      `command-line-args-left'.  (The entire list of command-line
  940.      arguments is in `command-line-args'.)
  941.  
  942.      The command line arguments are parsed by the `command-line-1'
  943.      function in the `startup.el' file.  See also *Note :
  944.      (emacs)Command Switches.
  945.  
  946.  * Variable: command-line-args
  947.      The value of this variable is the arguments passed by the shell
  948.      to Emacs, as a list of strings.
  949.  
  950.  
  951. 
  952. File: elisp,  Node: Getting Out,  Next: System Environment,  Prev: Starting Up,  Up: System Interface
  953.  
  954. Getting out of Emacs
  955. ====================
  956.  
  957.    There are two ways to get out of Emacs: you can kill the Emacs
  958. job, which exits permanently, or you can suspend it, which permits
  959. you to reenter the Emacs process later.  As a practical matter, you
  960. seldom kill Emacs--only when you are about to log out.  Suspending is
  961. much more common.
  962.  
  963. * Menu:
  964.  
  965. * Killing Emacs::        Exiting Emacs irreversibly.
  966. * Suspending Emacs::     Exiting Emacs reversibly.
  967.  
  968.  
  969. 
  970. File: elisp,  Node: Killing Emacs,  Next: Suspending Emacs,  Prev: Getting Out,  Up: Getting Out
  971.  
  972. Killing Emacs
  973. -------------
  974.  
  975.    Killing Emacs means ending the execution of the Emacs process.  It
  976. will return to its superior process.
  977.  
  978.    All the information in the Emacs process, aside from files that
  979. have been saved, is lost when the Emacs is killed.  Because killing
  980. Emacs inadvertently can lose a lot of work, Emacs will query for
  981. confirmation before actually terminating if you have buffers that
  982. need saving or subprocesses that are running.
  983.  
  984.  * Function: kill-emacs &optional NO-QUERY
  985.      This function exits the Emacs process and kills it.
  986.  
  987.      Normally, if there are modified files or if there are running
  988.      processes, `kill-emacs' asks the user for confirmation before
  989.      exiting.  However, if NO-QUERY is supplied and non-`nil', then
  990.      Emacs exits without confirmation.
  991.  
  992.      If NO-QUERY is an integer, then it is used as the exit status of
  993.      the Emacs process.  (This is useful primarily in batch
  994.      operation; see *Note Batch Mode::.)
  995.  
  996.      If NO-QUERY is a string, its contents are stuffed into the
  997.      terminal input buffer so that the shell (or whatever program
  998.      next reads input) can read them.
  999.  
  1000.  * Variable: kill-emacs-hook
  1001.      The value of the `kill-emacs-hook' variable is either `nil' or
  1002.      is that of a function to be called by `kill-emacs'.  The hook is
  1003.      called before anything else is done by `kill-emacs'.
  1004.  
  1005.  
  1006. 
  1007. File: elisp,  Node: Suspending Emacs,  Prev: Killing Emacs,  Up: Getting Out
  1008.  
  1009. Suspending Emacs
  1010. ----------------
  1011.  
  1012.    "Suspending Emacs" means stopping Emacs temporarily and returning
  1013. control to its superior process, which is usually the shell.  This
  1014. allows you to resume editing later in the same Emacs process, with
  1015. the same buffers, the same kill ring, the same undo history, and so
  1016. on.  To resume Emacs, use the appropriate command in the parent
  1017. shell--most likely `fg'.
  1018.  
  1019.    Some operating systems do not support suspension of jobs; on these
  1020. systems, "suspension" actually creates a new shell temporarily as a
  1021. subprocess of Emacs.  Then you would exit the shell to return to Emacs.
  1022.  
  1023.    Suspension is not useful with window systems such as X Windows,
  1024. because the Emacs job may not have a parent that can resume it again,
  1025. and in any case you can give input to some other job such as a shell
  1026. merely by moving to a different window.  Therefore, suspending is not
  1027. allowed under X Windows.
  1028.  
  1029.  * Function: suspend-emacs STRING
  1030.      This function stops Emacs and returns to the superior process. 
  1031.      It returns `nil'.
  1032.  
  1033.      If STRING is non-`nil', its characters are sent to be read as
  1034.      terminal input by Emacs's superior shell.  The characters in
  1035.      STRING will not be echoed by the superior shell; just the
  1036.      results will appear.
  1037.  
  1038.      Before suspending, Emacs examines the symbol `suspend-hook'.  If
  1039.      it is bound, and its value is non-`nil', then the value is
  1040.      called as a function of no arguments.  If the function returns
  1041.      non-`nil', then `suspend-emacs' returns immediately and
  1042.      suspension does not occur.
  1043.  
  1044.      After Emacs resumes, the symbol `suspend-resume-hook' is
  1045.      examined.  If it is bound and non-`nil', then the value is
  1046.      called as a function of no arguments.
  1047.  
  1048.      The next redisplay after resumption will redraw the entire
  1049.      screen, unless `no-redraw-on-reenter' is set (*note Screen
  1050.      Attributes::.).
  1051.  
  1052.      In the following example, note that `pwd' is not echoed after
  1053.      Emacs is suspended.  But it is read and executed by the shell.
  1054.  
  1055.           (suspend-emacs)
  1056.                => nil
  1057.           
  1058.           (setq suspend-hook
  1059.               (function (lambda ()
  1060.                         (not (y-or-n-p "Really suspend? ")))))
  1061.                => (lambda nil (not (y-or-n-p "Really suspend? ")))
  1062.           (setq suspend-resume-hook
  1063.               (function (lambda () (message "Resumed!"))))
  1064.                => (lambda nil (message "Resumed!"))
  1065.           (suspend-emacs "pwd")
  1066.                => nil
  1067.           ---------- Buffer: Minibuffer ----------
  1068.           Really suspend? `y'
  1069.           
  1070.           ---------- Parent Shell ----------
  1071.           lewis@slug[23] % /user/lewis/manual
  1072.           lewis@slug[24] % fg
  1073.           
  1074.           ---------- Echo Area ----------
  1075.           Resumed!
  1076.  
  1077.   * Variable: suspend-hook
  1078.      The value of the `suspend-hook' variable, if not `nil', is
  1079.      called as a function with no arguments by `suspend-emacs' before
  1080.      Emacs is actually suspended.  If the function returns non-`nil',
  1081.      then suspension does not take place.
  1082.  
  1083.  * Variable: suspend-resume-hook
  1084.      The value of the `suspend-resume-hook' variable, if not `nil',
  1085.      is called as a function with no arguments after resumption of an
  1086.      Emacs session that was suspended with `suspend-emacs'.
  1087.  
  1088.  
  1089. 
  1090. File: elisp,  Node: System Environment,  Next: Terminal Input,  Prev: Getting Out,  Up: System Interface
  1091.  
  1092. Operating System Environment
  1093. ============================
  1094.  
  1095.    Emacs provides access to variables in the operating system
  1096. environment through various functions.  These variables include the
  1097. name of the system, the user's UID, and so on.
  1098.  
  1099.  * Variable: system-type
  1100.      The value of this variable is a symbol indicating the type of
  1101.      operating system Emacs is operating on.  Here is a table of the
  1102.      symbols for the operating systems that Emacs can run on up to
  1103.      version 18.51.
  1104.  
  1105.     `berkeley-unix'
  1106.           Berkeley BSD 4.1, 4.2, or 4.3.
  1107.  
  1108.     `hpux'
  1109.           Hewlett-Packard operating system, version 5, 6, or 7.
  1110.  
  1111.     `silicon-graphics-unix'
  1112.           Silicon Graphics Iris 3.5 or 3.6.
  1113.  
  1114.     `rtu'
  1115.           RTU 3.0, UCB universe.
  1116.  
  1117.     `unisoft-unix'
  1118.           UniSoft's UniPlus 5.0 or 5.2.
  1119.  
  1120.     `usg-unix-v'
  1121.           AT&T's System V.0, System V Release 2.0, 2.2, or 3.
  1122.  
  1123.     `vax-vms'
  1124.           VMS VMS version 4 or 5.
  1125.  
  1126.     `xenix'
  1127.           SCO Xenix 386 Release 2.2.
  1128.  
  1129.      We do not wish to add new symbols to make finer distinctions
  1130.      unless it is absolutely necessary!  In fact, it would be nice to
  1131.      eliminate a couple of possibilities in the future.
  1132.  
  1133.  * Function: getenv VAR
  1134.      This function returns the value of the environment variable VAR,
  1135.      as a string.
  1136.  
  1137.           (getenv "USER")
  1138.                => "lewis"
  1139.           
  1140.           lewis@slug[10] % printenv
  1141.           PATH=.:/user/lewis/bin:/usr/bin:/usr/local/bin
  1142.           USER=lewis
  1143.           TERM=ibmapa16
  1144.           SHELL=/bin/csh
  1145.           HOME=/user/lewis
  1146.  
  1147.  * Function: user-login-name
  1148.      This function returns the name under which the user is logged in.
  1149.      This is based on the effective UID, not the real UID.
  1150.  
  1151.           (user-login-name)
  1152.                => "lewis"
  1153.  
  1154.  * Function: user-real-login-name
  1155.      This function returns the name under which the user logged in. 
  1156.      This is based on the real UID, not the effective UID.  This
  1157.      differs from `user-login-name' only when running with the setuid
  1158.      bit.
  1159.  
  1160.  * Function: user-full-name
  1161.      This function returns the full name of the user.
  1162.  
  1163.           (user-full-name)
  1164.                => "Bil Lewis"
  1165.  
  1166.  * Function: user-real-uid
  1167.      This function returns the real UID of the user.
  1168.  
  1169.           (user-real-uid)
  1170.                => 19
  1171.  
  1172.  * Function: user-uid
  1173.      This function returns the effective UID of the user.
  1174.  
  1175.  * Function: system-name
  1176.      This function returns the name of the machine you are running on.
  1177.  
  1178.           (system-name)
  1179.                => "prep.ai.mit.edu"
  1180.  
  1181.  * Function: current-time-string
  1182.      This function returns the current time and date as a
  1183.      humanly-readable string.  The format of the string is unvarying;
  1184.      the number of characters used for each part is always the same,
  1185.      so you can reliably use `substring' to extract pieces of it. 
  1186.      However, it would be wise to count the characters from the
  1187.      beginning of the string rather than from the end, as additional
  1188.      information describing the time zone may be added in version 19.
  1189.  
  1190.           (current-time-string)
  1191.                => "Wed Oct 14 22:21:05 1987"
  1192.  
  1193.  * Function: load-average
  1194.      This function returns the current 1 minute, 5 minute and 15
  1195.      minute load averages in a list.  The values are integers that
  1196.      are 100 times the system load averages.  (The load averages
  1197.      indicate the number of processes trying to run.)
  1198.  
  1199.           (load-average)
  1200.                => (169 48 36)
  1201.           
  1202.           lewis@rocky[5] % uptime
  1203.            11:55am  up 1 day, 19:37,  3 users,  load average: 1.69, 0.48, 0.36
  1204.  
  1205.  * Function: setprv PRIVILEGE-NAME &optional SETP GETPRV
  1206.      This function sets or resets a VMS privilege.  (It does not
  1207.      exist on Unix.)  The first arg is the privilege name, as a
  1208.      string.  The second argument, SETP, is `t' or `nil', indicating
  1209.      whether the privilege is to be turned on or off.  Its default is
  1210.      `nil'.  The function returns `t' if success, `nil' if not.
  1211.  
  1212.      If the third argument, GETPRV, is non-`nil', `setprv' does not
  1213.      change the privilege, but returns `t' or `nil' indicating
  1214.      whether the privilege is currently enabled.
  1215.  
  1216.  
  1217.